Skip to content

Reject non-ASCII letters in Spanish identifiers - #576

Open
prathamchoksi wants to merge 1 commit into
python-validators:masterfrom
prathamchoksi:fix/spanish-id-ascii-before-normalization
Open

prathamchoksi wants to merge 1 commit into
python-validators:masterfrom
prathamchoksi:fix/spanish-id-ascii-before-normalization

Conversation

@prathamchoksi

Copy link
Copy Markdown

Fixes #575.

Check the complete Spanish identifier for ASCII before uppercase conversion. Currently 00000038\u017f and 00000038\u00df pass NIF validation, and \u017f0000000J passes CIF validation. The sharp-s case expands into two letters, but indexing only the first one still accepts the malformed value. NIE and the DOI dispatcher are affected too.

Move the existing ASCII restriction from the numeric body to the complete original value. Checksums and existing ASCII case handling remain unchanged. Eight new regressions fail on master and pass with the fix, with valid ASCII and lowercase-check-letter controls.

Validation: 1,582 tests including source doctests pass on Python 3.11 and 3.14. Tox lint and strict Pyright pass, along with Ruff format checks and Bandit. Python 3.12/3.13 are left to CI. Codex assisted with investigation, implementation, and testing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spanish identifier validators accept non-ASCII letters after case conversion

1 participant